/* 不使用async await 实现一个函数createFlow,使得以下代码输出方式如下：
// 延迟1s
1
2
// 延迟3s
3
4
*/
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const log = console.log
createFlow([
    () => delay(1000).then(() => log(1)),
    () => log(2),
    () => delay(3000).then(() => log(3)),
    () => log(4),
])
function createFlow(arr) {
    // coding here
}